import request from "@/utils/request";
// 调用权限
export default {
  //查看菜单列表
  getList(data) {
    return request({
      url: "/api/accounts/menu/",
      method: "get",
      params: data
    });
  },
  //修改菜单
  editMenu(id, data) {
    return request({
      url: "/api/accounts/menu/" + id+"/",
      method: "put",
      data: data
    });
  },
  //新增菜单
  addMenu(data) {
    return request({
      url: "/api/accounts/menu/",
      method: "post",
      data: data
    });
  },
  //删除菜单
  deleteMenu(id) {
    return request({
      url: "/api/accounts/menu/" + id + "/",
      method: "delete"
    });
  },
  getWebRouter(data) {
    return request({
      url: "/api/accounts/menu/web_router/",
      method: "get",
      params: data
    });
  },
  getMenuButton(data){
    return request({
      url: "/api/accounts/menu_button/",
      method: "get",
      params: data
    });
  },
  //修改菜单按钮
  editMenuButton(id, data) {
    return request({
      url: "/api/accounts/menu_button/" + id + "/",
      method: "put",
      data: data
    });
  },
  //新增菜单按钮
  addMenuButton(data) {
    return request({
      url: "/api/accounts/menu_button/",
      method: "post",
      data: data
    });
  },
  //删除菜单按钮
  deleteMenuButton(id) {
    return request({
      url: "/api/accounts/menu_button/" + id + "/",
      method: "delete"
    });
  },
  //获取所有的api地址
  getUrls() {
    return request({
      url: "/api/geturls/",
      method: "get"
    });
  },
  setAccountsMenuCopy(id,data) {
    return request({
      url: "/api/accounts/menu/"+id+"/copy/",
      method: "post",
      data
    });
  },
};
